<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script type="text/javascript">

    // 编写一个javaScript的对象

    var user = {
      name:"张jz",
      age:3,
      sex:"男"
    }

    var json = JSON.stringify(user);
    console.log(json);

    console.log(user);



    // 将JSON对象转换为字符串
    var obj = JSON.parse(json);
    console.log(obj);


  </script>

</head>
<body>


</body>
</html>